<%@page
	import="Model.UserModel"

%>
<%@page
	import="POJO.UserPOJO"

%>
<% String id = (String)request.getAttribute("id"); 
	UserPOJO user = null;	

	if(id != null)
	{
		user  = UserModel.selectUserByID(id);
	}
%>
<!-- start content-outer -->
<div id="content-outer">
<!-- start content -->
<div id="content">


<div id="page-heading"><h1><% if(user!=null){out.print("Update User");}else{out.print("Add User");} %></h1></div>


<table border="0" width="100%" cellpadding="0" cellspacing="0" id="content-table">
<tr>
	<th rowspan="3" class="sized"><img src="images/shared/side_shadowleft.jpg" width="20" height="300" alt="" /></th>
	<th class="topleft"></th>
	<td id="tbl-border-top">&nbsp;</td>
	<th class="topright"></th>
	<th rowspan="3" class="sized"><img src="images/shared/side_shadowright.jpg" width="20" height="300" alt="" /></th>
</tr>
<tr>
	<td id="tbl-border-left"></td>
	<td>
	<!--  start content-table-inner -->
	<div id="content-table-inner">
	
	<table border="0" width="100%" cellpadding="0" cellspacing="0">
	<tr valign="top">
	<td>

	
		<!-- start id-form -->
<form action="user" method="post" >
		<table border="0" cellpadding="0" cellspacing="0"  id="id-form">
		<tr>
			<th valign="top">Username:</th>
			<td><input type="text" name="txtusername" class="inp-form" value="<%if(user != null) out.print(user.getUsername()); %>" /></td>
			<td></td>
		</tr>
		<tr>
		<th valign="top">Category:</th>
		<td>	
		<select name="txtType" class="styledselect_form_1" >
			<option value="System Admin" <% if(user!=null && user.getType().equals("System Admin")) {%> selected="selected"<%} %>>System Admin</option>
			<option value="Customer Service" <% if(user!=null && user.getType().equals("Customer Service")) {%> selected="selected"<%} %>>Customer Service</option>
			<option value="Merchandise" <% if(user!=null && user.getType().equals("Merchandise")) {%> selected="selected"<%} %>>Merchandise</option>
			<option value="Accountant"<% if(user!=null && user.getType().equals("Accountant")) {%> selected="selected"<%} %>>Accountant</option>
		</select>
		</td>
		<td></td>
		</tr>
		<tr>
			<th valign="top">PassWord</th>
			<td><input type="password" name="txtPassWord" class="inp-form" /></td>
			<td></td>
		</tr>
		<tr>
		<td class="noheight">
		
			<table border="0" cellpadding="0" cellspacing="0">
			<tr  valign="top">
			</tr>
			</table>
		
		</td>
		<td>
			<input type="hidden" value="<%if(user!=null) {out.print("Edit");}else{out.print("Add");}%>" name="do"/>
			<input type="hidden" value="<%if(user!=null) out.print(user.getId()); %>" name="idedit"/>
		</td>
	</tr>
	<tr>
		<th>&nbsp;</th>
		<td valign="top">
			
			<input type="submit" value="Submit" class="form-submit" name="btnSubMit"> 
			<input type="reset" value="Reset"	name="btnReset" class="form-reset">
		</td>
		<td></td>
	</tr>
	</table>
	<!-- end id-form  -->
</form>
	</td>
	
</tr>
<tr>
<td><img src="images/shared/blank.gif" width="695" height="1" alt="blank" /></td>
<td></td>
</tr>
</table>
 
<div class="clear"></div>
 

</div>
<!--  end content-table-inner  -->
</td>
<td id="tbl-border-right"></td>
</tr>
<tr>
	<th class="sized bottomleft"></th>
	<td id="tbl-border-bottom">&nbsp;</td>
	<th class="sized bottomright"></th>
</tr>
</table>




<div class="clear">&nbsp;</div>

</div>
<!--  end content -->
<div class="clear">&nbsp;</div>
</div>
<!--  end content-outer -->